package com.yinhe.system.service.impl;

import java.util.List;
import com.yinhe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yinhe.system.mapper.YhEducationMapper;
import com.yinhe.system.domain.YhEducation;
import com.yinhe.system.service.IYhEducationService;

/**
 * 职业教育学习档案Service业务层处理
 * 
 * @author yinhe
 * @date 2022-09-24
 */
@Service
public class YhEducationServiceImpl implements IYhEducationService 
{
    @Autowired
    private YhEducationMapper yhEducationMapper;

    /**
     * 查询职业教育学习档案
     * 
     * @param studyRecordId 职业教育学习档案主键
     * @return 职业教育学习档案
     */
    @Override
    public YhEducation selectYhEducationByStudyRecordId(Long studyRecordId)
    {
        return yhEducationMapper.selectYhEducationByStudyRecordId(studyRecordId);
    }

    /**
     * 查询职业教育学习档案列表
     * 
     * @param yhEducation 职业教育学习档案
     * @return 职业教育学习档案
     */
    @Override
    public List<YhEducation> selectYhEducationList(YhEducation yhEducation)
    {
        return yhEducationMapper.selectYhEducationList(yhEducation);
    }

    /**
     * 新增职业教育学习档案
     * 
     * @param yhEducation 职业教育学习档案
     * @return 结果
     */
    @Override
    public int insertYhEducation(YhEducation yhEducation)
    {
        yhEducation.setCreateTime(DateUtils.getNowDate());
        return yhEducationMapper.insertYhEducation(yhEducation);
    }

    /**
     * 修改职业教育学习档案
     * 
     * @param yhEducation 职业教育学习档案
     * @return 结果
     */
    @Override
    public int updateYhEducation(YhEducation yhEducation)
    {
        yhEducation.setUpdateTime(DateUtils.getNowDate());
        return yhEducationMapper.updateYhEducation(yhEducation);
    }

    /**
     * 批量删除职业教育学习档案
     * 
     * @param studyRecordIds 需要删除的职业教育学习档案主键
     * @return 结果
     */
    @Override
    public int deleteYhEducationByStudyRecordIds(Long[] studyRecordIds)
    {
        return yhEducationMapper.deleteYhEducationByStudyRecordIds(studyRecordIds);
    }

    /**
     * 删除职业教育学习档案信息
     * 
     * @param studyRecordId 职业教育学习档案主键
     * @return 结果
     */
    @Override
    public int deleteYhEducationByStudyRecordId(Long studyRecordId)
    {
        return yhEducationMapper.deleteYhEducationByStudyRecordId(studyRecordId);
    }
}
